<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20110101;15071300">
	<STYLE TYPE="text/css">
	<!--
		@page { margin: 0.79in }
		P { margin-bottom: 0.08in }
		PRE { font-family: "Times New Roman" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="el-GR" DIR="LTR">
<PRE LANG="en-US"><FONT SIZE=5><B>Complex upper-Hessenberg matrices</B></FONT>

<FONT SIZE=5><SPAN LANG="en-US"><B>valqricom</B></SPAN></FONT>


<FONT SIZE=4><SPAN LANG="en-US"><SPAN STYLE="font-style: normal">for</SPAN> details see book of Hang T. Lau, “A Java Numerical Library for Scientists and engineers|”, Chapman &amp; Hall, 2004</SPAN></FONT>

<FONT SIZE=4><SPAN LANG="en-US"><B>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to open the editor)</B></SPAN></FONT>




<SPAN LANG="en-US">import java.text.DecimalFormat;</SPAN>
<SPAN LANG="en-US">import numal.*;</SPAN>

<SPAN LANG="en-US">public class Test_valqricom extends Object {</SPAN>
<SPAN LANG="en-US">	</SPAN>
<SPAN LANG="en-US">	public static void main(String args[]) {</SPAN>

    <SPAN LANG="en-US">int i;</SPAN>
    <SPAN LANG="en-US">double b[] = new double[4];</SPAN>
    <SPAN LANG="en-US">double val1[] = new double[5];</SPAN>
    <SPAN LANG="en-US">double val2[] = new double[5]; </SPAN>
    <SPAN LANG="en-US">double em[] = new double[6];</SPAN>
    <SPAN LANG="en-US">double a1[][] = new double[5][5];</SPAN>
    <SPAN LANG="en-US">double a2[][] = new double[5][5];</SPAN>
    
    <SPAN LANG="en-US">Basic.inimat(1,4,1,4,a1,0.0);</SPAN>
    <SPAN LANG="en-US">Basic.inimat(1,4,1,4,a2,0.0);</SPAN>
    <SPAN LANG="en-US">a1[1][1] = -4.0;  a1[1][2] = -5.0;</SPAN>
    <SPAN LANG="en-US">a1[1][3] = a2[1][1] = a2[1][4] = -2.0;</SPAN>
    <SPAN LANG="en-US">a2[1][2] = a2[1][3] = -6.0;</SPAN>
    <SPAN LANG="en-US">b[1]=b[2]=b[3]=1.0;</SPAN>
    <SPAN LANG="en-US">em[0]=5.0e-6;  em[1]=27.0;  em[2]=1.0e-6;  em[4]=15.0;</SPAN>
    <SPAN LANG="en-US">DecimalFormat fiveDigit = new DecimalFormat(&quot;0.00000E0&quot;);</SPAN>
    <SPAN LANG="en-US">System.out.println(&quot;VALQRICOM:  &quot; + </SPAN>
           <SPAN LANG="en-US">Linear_algebra.valqricom(a1,a2,b,4,em,val1,val2));</SPAN>
    <SPAN LANG="en-US">System.out.println(&quot;\nEigenvalues:\n\t&quot; +</SPAN>
      <SPAN LANG="en-US">&quot;Real part\tImaginary part&quot;);</SPAN>
    <SPAN LANG="en-US">for (i=1; i&lt;=4; i++)</SPAN>
      <SPAN LANG="en-US">System.out.println(&quot;\t&quot; + fiveDigit.format(val1[i]) +</SPAN>
        <SPAN LANG="en-US">&quot;\t&quot; + fiveDigit.format(val2[i]));</SPAN>
    <SPAN LANG="en-US">System.out.println(&quot;\nEM[3]:  &quot; + </SPAN>
      <SPAN LANG="en-US">fiveDigit.format(em[3]) + &quot;\nEM[5]:  &quot; + (int)em[5]);</SPAN>
<SPAN LANG="en-US">	}</SPAN>
<SPAN LANG="en-US">}</SPAN>

</PRE>
</BODY>
</HTML>